package cn.zxone.feishu.demo.common.config;

import cn.zxone.feishu.demo.common.properties.FeiShuProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;


/**
 * <p>
 * 飞书配置
 * </p>
 *
 * @author zhangxue
 * @since 2025-04-09 11:17:24
 */
@Slf4j
@Configuration
@AutoConfigureAfter(StringRedisTemplate.class)
@EnableConfigurationProperties(FeiShuProperties.class)
@ConditionalOnProperty(prefix = FeiShuProperties.PREFIX, name = "enable", havingValue = "true", matchIfMissing = false)
public class FeiShuAutoConfiguration {

    @Bean
    public FeiShuClientManager feiShuClientManager(FeiShuProperties feiShuProperties, StringRedisTemplate stringRedisTemplate) {

        return new FeiShuClientManager(feiShuProperties, stringRedisTemplate);
    }


}



